const mongoose = require("mongoose");
mongoose.pluralize(null); //去掉集合后面的s
const { Schema, model } = mongoose;
const versionKey = { versionKey: false };
const moment = require("moment");
moment.locale("zh-cn");

// 中国省市数据
const ChcitySchema = new Schema({
  cityName: {
    type: String,
  },
});
const ProvinceSchema = new Schema(
  {
    provinceName: String,
    citys: {
      type: [ChcitySchema],
    },
  },
  versionKey
);

module.exports = {
  modelProvince: model("chinacity", ProvinceSchema),
};
